<template>
  <div>
    <!-- 头部tab -->
    <!-- <div class="top_tab">
      <div class="left" @click="back()">
        <img  src="../assets/order_center/shangs.png">
      </div>
      <span>鸿包惠</span>
      <div class="right">
      </div>
    </div> -->
		<!-- <div class="kong"></div> -->
    <div class="list">
			<div class="boxt">
				<div class="info">
					<span>委托金额：</span><input v-model="price" type="number" placeholder="请输入委托金额">
				</div>
			</div>
			<div class="boxt">
				<div class="info">
					<span>债事编号：</span><input v-model="debtnum" type="text" placeholder="请输入债事编号">
				</div>
			</div>
			<div class="btn">
				<button class="affirm" @click="isOk()">确认</button>
				<button class="cancel" @click="back()">取消</button>
			</div>
		</div>
		
	</div>
</template>

<script>
export default {
  name: 'detail',
  data () {
    return {
			price:'',
			debtnum:''
    }
  },
  methods:{
    back: function() {
      this.$router.go(-1);
		},
		isOk(){
			let self = this;
			if(!this.price){
        this.$dialog.toast({mes:'请输入金额'});
        return
			}
			if(this.price==0){
        this.$dialog.toast({mes:'金额不能为零'});
        return
			}
			if(!this.debtnum){
        this.$dialog.toast({mes:'请输入债事编号'});
        return
			}
      let url ="/api/entrustcheck";
      self.httpPost(url,{token:this.token,user_id:this.myid,price:this.price,debtnum:this.debtnum,type:0,num:''},function(res) {
				if (res.code === 200) {
					self.$dialog.toast({mes:res.msg});
					setTimeout(() => {
            self.$router.go(-1);
          }, 1000);
        }else{
     	   self.$dialog.toast({mes:res.msg});
				}
      })
		}
	},
	created(){
    document.title = "鸿包惠";
    this.token = localStorage.getItem('mytoken');
		this.myid = localStorage.getItem('myid');
  }
}
</script>


<style scoped>
.top_tab{
  width:100%;
  padding:.2rem .3rem;
  background: #FFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: .01rem .01rem .06rem #ddd;
  margin-bottom: .03rem;
  position: fixed;
}
.kong{
	width:100%;
	height:.92rem;
}
.top_tab span{
  color:#333;
  font-size: .36rem;
}
.top_tab .right{
	width: 1rem;
	display: flex;
	justify-content: space-between;
}
.top_tab  img{
  width:.43rem;
}
.list{
	width:100%;
	padding: 0 .3rem;
	background: #FFF;
}
.list .boxt{
	width:100%;
	height:1rem;
	background: #FFF;
	display: flex;
	align-items: center;
	
}
.list .boxt .info{
	width:100%;
	height:100%;
	border-bottom: 1px solid #eee;
	display: flex;
	align-items: center;

}

.list .boxt .info span{
	font-size: .28rem;
	color:#707070;
}
.boxt span{
	font-size: .28rem;
	color:#333;
}
.boxt input{
	border:none;
	flex: 1;
}
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { 
	color: #9e9e9e; 
} 
input:-moz-placeholder, textarea:-moz-placeholder { 
	color: #9e9e9e; 
} 
input::-moz-placeholder, textarea::-moz-placeholder { 
	color: #9e9e9e; 
} 
input:-ms-input-placeholder, textarea:-ms-input-placeholder { 
	color: #9e9e9e; 
} 
.btn{
	width:100%;
	display: flex;
	justify-content: center;
	padding: .2rem .2rem;
}
.btn .affirm{
	width: 1.18rem;
	height:.60rem;
	background: #e63f3f;
	border: none;
	border-radius: 5px;
	font-size: .28rem;
	color:#FFF;
}
.btn .cancel{
	width: 1.18rem;
	height:.60rem;
	background: #e7e6e9;
	border: none;
	border-radius: 5px;
	font-size: .28rem;
	color:#adadad;
	margin-left: .5rem;
}
.title{
	margin-top: .6rem;
	width:100%;
	display: flex;
	justify-content: center;
}
</style>



